home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1997 August
/
Walnut Creek CDROM.7z
/
LISTINGS
/
V_13_07
/
ROSS
/
SSFIND.C
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
C/C++ Source or Header
|
1995-04-30
|
321 b
|
16 lines
#include <stdio.h>
#include <string.h>
int ssFind(int n, char *txt, int m, char *pat)
{ int nmatch = 0;
char *cp;
cp = txt;
while (cp = strstr(cp, pat))
{ printf("%d\n",cp-txt);
nmatch++;
cp++;
}
return(nmatch);
}
Figure 4. String searching function using C library function strstr().